<!DOCTYPE html>
<html>
<head>
<title>Notifications</title>
<?php
$login = $_GET ["login"];
if (empty ( $_GET ["rm"] )) {
	echo '<meta charset="utf-8" HTTP-EQUIV="Refresh"';
	echo '	CONTENT="8; URL=http://fr-d134685.groupinfra.com/showroom/iBeacon_project/iBeacon_project/web/client_notifications8.php?login=' . $login . '">';
} else {
	echo '<meta charset="utf-8" HTTP-EQUIV="Refresh"';
	echo '	CONTENT="8; URL=http://fr-d134685.groupinfra.com/showroom/iBeacon_project/iBeacon_project/web/client_notifications8.php?login=' . $login . '&rm=true">';
}
if (empty ( $_GET ["del"] )) {
	echo '<meta charset="utf-8" HTTP-EQUIV="Refresh"';
	echo '	CONTENT="8; URL=http://fr-d134685.groupinfra.com/showroom/iBeacon_project/iBeacon_project/web/client_notifications8.php?login=' . $login . '">';
} else {
	$valDel = $_GET ["del"];
	echo '<meta charset="utf-8" HTTP-EQUIV="Refresh"';
	echo '	CONTENT="8; URL=http://fr-d134685.groupinfra.com/showroom/iBeacon_project/iBeacon_project/web/client_notifications8.php?login=' . $login . '&del=' . $valDel . '">';
}
?>
<meta name="viewport" charset="utf-8"
	content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->
<link href="../css/bootstrap.min.css" rel="stylesheet" media="screen">
<!-- My style -->
<link href="../css/bootstrap.css" rel="stylesheet" media="screen">
<link href="../css/alert.css" rel="stylesheet">
<link href="../css/notification.css" rel="stylesheet">
</head>
<body>
	<div class="container">
		<div class="row">
			<br />
			<div
				class="col-xs-6 col-xs-offset-3 col-sm-6 col-md-3 col-lg-offset-4">
				<img class="profile-img img-responsive" src="../img/zodio.gif"
					style="border-radius: 8px;">
			</div>

			<br /> <br />

			<div class="col-md-12">
				<h2
					style="font-family: Helvetica neue; color: white; visibility: hidden;">
					<b>-</b>
				</h2>
				
						<?php
						$login = $_GET ["login"];
						if ((empty ( $_GET ["del"] )) || ((! empty ( $_GET ["del"] ) && $_GET ["del"] != 1))) {
							echo '<div class="alert-message warning alert-dismissable">';
							echo '<span class="glyphicon glyphicon-certificate"></span>';
							if (empty ( $_GET ["rm"] )) {
								if (empty ( $_GET ["del"] )) {
									echo '	<a class="close" href="./client_notifications8.php?login=' . $login . '&del=1" data-dismiss="alert"';
									echo '		aria-hidden="true"><i class="glyphicon glyphicon-remove"></i></a>';
								} else {
									echo '	<a class="close" href="./client_ne_plus_solliciter.php?login=' . $login . '" data-dismiss="alert"';
									echo '		aria-hidden="true"><i class="glyphicon glyphicon-remove"></i></a>';
								}
								echo '<a href="./client_bienvenue_colis.php?login=' . $login . '&colis=true&lu=true"><strong>Bienvenue chez Zodio !</strong>';
								echo ' Votre colis est pret !</a>';
							} else {
								echo '	<a class="close" href="./client_notifications8.php?login=' . $login . 'del=1" data-dismiss="alert"';
								echo '		aria-hidden="true"><i class="glyphicon glyphicon-remove"></i></a>';
								echo '<a href="./client_bienvenue_colis.php?login=' . $login . '&colis=true&lu=true&rm=true"><strong>Bienvenue chez Zodio !</strong>';
								echo ' Votre colis est pret !</a>';
							}
							echo '</div>';
						}
						
						if ((empty ( $_GET ["del"] )) || ((! empty ( $_GET ["del"] ) && $_GET ["del"] != 2))) {
							if (empty ( $_GET ["rm"] )) {
								echo '<div class="alert-message success alert-dismissable">';
								echo '	<span class="glyphicon glyphicon-certificate"></span>';
								if (empty ( $_GET ["del"] )) {
									echo '	<a class="close" href="./client_notifications8.php?login=' . $login . '&del=2" data-dismiss="alert"';
									echo '		aria-hidden="true"><i class="glyphicon glyphicon-remove"></i></a>';
								} else {
									echo '	<a class="close" href="./client_ne_plus_solliciter.php?login=' . $login . '" data-dismiss="alert"';
									echo '		aria-hidden="true"><i class="glyphicon glyphicon-remove"></i></a>';
								}
								echo '<a href="./client_bienvenue_cuisine.php?login=' . $login . '&colis=true" style="color: white;" ><strong>Bienvenue chez Zodio !</strong>';
								echo ' Votre cours de cuisine commence dans 10 minutes.</a>';
								echo '</div>';
							}
						}
						?>
				<?php
				require_once ("../services/ResponsableService.php");
				$login = $_GET ["login"];
				
				$responsableService = new ResponsableService ();
				if ($login == "mergoa") {
					$_SESSION ['promoNonLu'] = $responsableService->getPromoNonLuClient ( "3" );
				} else {
					$_SESSION ['promoNonLu'] = $responsableService->getPromoNonLuClient ( "2" );
				}
				
				$listPromoClient = $_SESSION ['promoNonLu'];
				if ($listPromoClient != null) {
					foreach ( $listPromoClient as $historique ) {
						$numPromo = $historique->getNumPromo ();
						$article = $responsableService->getArticlePromo ( $numPromo );
						echo ' <div class="alert-message warning alert-dismissable">';
						echo ' 	<span class="glyphicon glyphicon-certificate"></span> <a';
						echo ' 	class="close" href="../action/enleverNotifAction.php?login=' . $login . '&numPromo=' . $numPromo . '&numClient=2" data-dismiss="alert" aria-hidden="true"><i';
						echo ' 		class="glyphicon glyphicon-remove"></i></a>';
						echo '		<a href="./client_affichage_promo.php?id=' . $article->getNumArticle () . '&login=' . $login . '"><strong>Vous avez recu une promotion !</strong>';
						echo ' 		Profitez en elle est exclusivement pour vous !</a>';
						echo ' </div>';
					}
				}
				?>
			</div>
		</div>
	</div>

</body>
<footer>
	<script src="http://code.jquery.com/jquery.js"></script>
	<script src="../js/bootstrap.js"></script>
</footer>
</html>